<%
# Copyright (C) 2015 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<%= fields_for :settings, OpenObject.new(settings) do |f| %>
  <table style="width: 500px;" class="formtable">
    <tr>
      <td colspan="2">
        <p><%= t(:description, <<-TEXT)
          Pushes events to a Kinesis stream.
          TEXT
        %></p>
      </td>
    </tr>
    <tr>
      <td><%= f.blabel :use_consul, :en => "Configure using Consul instead of this page" %></td>
      <td>
        <%= f.check_box :use_consul %>
      </td>
    </tr>
    <tr>
      <td><%= f.blabel :kinesis_stream_name, :en => "Kinesis Stream Name" %></td>
      <td>
        <%= f.text_field :kinesis_stream_name %>
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <p><%= t(:endpoint_region_requirement, <<-TEXT)
        Either the AWS Region or Endpoint are required. The endpoint is typically only
        used for development.
        TEXT
        %></p>
      </td>
    </tr>
    <tr>
      <td><%= f.blabel :aws_region, :en => "AWS Region" %></td>
      <td>
        <%= f.text_field :aws_region %>
      </td>
    </tr>
    <tr>
      <td><%= f.blabel :aws_endpoint, :en => "AWS Endpoint (url)" %></td>
      <td>
        <%= f.text_field :aws_endpoint %>
      </td>
    </tr>
    <tr>
      <td><%= f.blabel :aws_access_key_id, :en => "AWS Access Key ID" %></td>
      <td>
        <%= f.text_field :aws_access_key_id %>
      </td>
    </tr>
    <tr>
      <td><%= f.blabel :aws_secret_access_key, :en => "AWS Secret Access Key" %></td>
      <td>
        <%= f.password_field :aws_secret_access_key %>
      </td>
    </tr>
  </table>
<% end %>


